//
import { ResponseStructure } from '@/typings/request';
import { request } from '@umijs/max';

import {
  AverageDaySupplyType,
  BleedingTemperatureType,
  GetFishTypeProportionType,
  GetPHMonitorType,
  GetPassRateTrendType,
  GetRawMaterialFishTopFiveType,
  GetRawMaterialFishType,
  TempTemperatureType,
  VideoIpType,
} from './typing';

export enum ApiUrl {
  GETRAWMATERIALFISH = '/back/bigData/getRawMaterialFish', // 1楼看板-原料鱼供应量
  GETBLEEDINGTEMPERATUREMONITOR = '/back/bigData/getBleedingTemperatureMonitor', // 1楼看板-放血池温度监控
  GETTEMPTEMPERATUREMONITOR = '/back/bigData/getTempTemperatureMonitor', // 1楼看板-暂养池温度监控
  GETPHMONITOR = '/back/bigData/getPHMonitor', // 1楼看板-放血池PH值监控
  GETPASSRATETREND = '/back/bigData/getPassRateTrend', // 1楼看板-合格率趋势
  GETFISHTYPEPROPORTION = '/back/bigData/getFishTypeProportion', // 1楼看板-加工鱼类型占比
  GETRAWMATERIALFISHTOPFIVE = '/back/bigData/getRawMaterialFishTopFive', // 1楼看板-原料鱼类累计供应top5
  AVERAGEDAYSUPPLY = '/back/bigData/averageDaySupply', // 1楼看板-鱼塘信息
  GETIPLIST = '/web/condition/getIpList', // 视频监控ip
  IceMachineMonitor='/back/bigData/getIceMachineMonitor',//制冰机
  BizAlarm='/back/bigData/getBizAlarm',//报警
  SeparatorMonitor='/back/bigData/getSeparatorMonitor',//分选机
  KwhMonitor='/back/bigData/getKwhMonitor',//电量
}

// 1楼看板-原料鱼供应量
export async function getRawMaterialFish(data: GetRawMaterialFishType.Body) {
  return request<ResponseStructure<GetRawMaterialFishType.Response[]>>(
    ApiUrl.GETRAWMATERIALFISH,
    {
      method: 'POST',
      data,
    },
  );
}

// 1楼看板-放血池温度监控
export async function getBleedingTemperatureMonitor(
  data: BleedingTemperatureType.Body,
) {
  return request<ResponseStructure<BleedingTemperatureType.Response[]>>(
    ApiUrl.GETBLEEDINGTEMPERATUREMONITOR,
    {
      method: 'POST',
      data,
    },
  );
}

// 1楼看板-暂养池温度监控
export async function getTempTemperatureMonitor(
  data: TempTemperatureType.Body,
) {
  return request<ResponseStructure<TempTemperatureType.Response[]>>(
    ApiUrl.GETTEMPTEMPERATUREMONITOR,
    {
      method: 'POST',
      data,
    },
  );
}

// 1楼看板-放血池PH值监控
export async function getPHMonitor(data: GetPHMonitorType.Body) {
  return request<ResponseStructure<GetPHMonitorType.Response[]>>(
    ApiUrl.GETPHMONITOR,
    {
      method: 'POST',
      data,
    },
  );
}

// 1楼看板-合格率趋势
export async function getPassRateTrend(data: GetPassRateTrendType.Body) {
  return request<ResponseStructure<GetPassRateTrendType.Response>>(
    ApiUrl.GETPASSRATETREND,
    {
      method: 'POST',
      data,
    },
  );
}

// 1楼看板-加工鱼类型占比
export async function getFishTypeProportion(
  data: GetFishTypeProportionType.Body,
) {
  return request<ResponseStructure<GetFishTypeProportionType.Response[]>>(
    ApiUrl.GETFISHTYPEPROPORTION,
    {
      method: 'POST',
      data,
    },
  );
}

// 1楼看板-原料鱼类累计供应top5
export async function getRawMaterialFishTopFive(
  data: GetRawMaterialFishTopFiveType.Body,
) {
  return request<ResponseStructure<GetRawMaterialFishTopFiveType.Response[]>>(
    ApiUrl.GETRAWMATERIALFISHTOPFIVE,
    {
      method: 'POST',
      data,
    },
  );
}

// 1楼看板-鱼塘信息
export async function averageDaySupply(data: AverageDaySupplyType.Body) {
  return request<ResponseStructure<AverageDaySupplyType.Response[]>>(
    ApiUrl.AVERAGEDAYSUPPLY,
    {
      method: 'POST',
      data,
    },
  );
}

// 获取视频ip地址
export async function getIpList(data: VideoIpType.Body) {
  return request<ResponseStructure<VideoIpType.Response[]>>(ApiUrl.GETIPLIST, {
    method: 'POST',
    data,
  });
}
// 制冰机
export async function getIceMachineMonitor(data: GetPassRateTrendType.Body) {
  return request<ResponseStructure<GetPassRateTrendType.Response>>(
    ApiUrl.IceMachineMonitor,
    {
      method: 'POST',
      data,
    },
  );
}
// 报警
export async function getBizAlarm(data: GetPassRateTrendType.Body) {
  return request<ResponseStructure<GetPassRateTrendType.Response>>(
    ApiUrl.BizAlarm,
    {
      method: 'POST',
      data,
    },
  );
}
// 分选机
export async function getSeparatorMonitor(data: GetPassRateTrendType.Body) {
  return request<ResponseStructure<GetPassRateTrendType.Response>>(
    ApiUrl.SeparatorMonitor,
    {
      method: 'POST',
      data,
    },
  );
}
// 电量
export async function getKwhMonitor(data: GetPassRateTrendType.Body) {
  return request<ResponseStructure<GetPassRateTrendType.Response>>(
    ApiUrl.KwhMonitor,
    {
      method: 'POST',
      data,
    },
  );
}
